package com.zzzy.cont.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 合同基本信息
 *
 * @author fc
 * @since 2024-05-27
 */
@Getter
@Setter
@TableName("contract")
@Schema(description = "合同基本信息")
public class Contract {

    @Schema(description = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "文件编号，可作为合同唯一标识")
    @TableField("con_no")
    private String conNo;

    @Schema(description = "订单编号")
    @TableField("order_no")
    private String orderNo;

    @Schema(description = "合同名称")
    @TableField("name")
    private String name;

    @Schema(description = "交易类型：采购、销售")
    @TableField("trade_type")
    private String tradeType;

    @Schema(description = "合同类型")
    @TableField("con_type")
    private String conType;

    @Schema(description = "交易公司名称")
    @TableField("trade_company")
    private String tradeCompany;

    @Schema(description = "合同金额")
    @TableField("total")
    private BigDecimal total;

    @Schema(description = "是否有固定期限(是/否)")
    @TableField("`has_period`")
    private String hasPeriod;

    @Schema(description = "固定期限开始时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @TableField("begin_period_time")
    private LocalDate beginPeriodTime;

    @Schema(description = "固定期限结束时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @TableField("end_period_time")
    private LocalDate endPeriodTime;

    @Schema(description = "办理状态：起草中、审核中、签订中、已归档、已废弃")
    @TableField("`status`")
    private String status;

    @Schema(description = "起草人ID")
    @TableField("user_id")
    private Long userId;

    @Schema(description = "起草人真实姓名")
    @TableField("user_name")
    private String userName;

    @Schema(description = "当前办理人ID")
    @TableField("operator_id")
    private Long operatorId;

    @Schema(description = "当前办理人姓名")
    @TableField("operator_name")
    private String operatorName;

    @Schema(description = "备注")
    @TableField("memo")
    private String memo;

    @Schema(description = "新建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "修改时间(办理文件中则代表提交时间)")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
